<template>
	<view>
		<view class="pad-lr-10 mar-top-20 radius-16 my_bi_view over-hid">
			<view class="col-f fontSize-30 text-align-center mar-top-50">我的团队</view>
			<view class="col-f fontSize-32 text-align-center mar-top-50 fontBold">{{num}}人</view>
		</view>
	<view class="pad-tb-40 display align-items view_view" v-for="item in list" :key="item.id">
		<image :src="item.avatar" class="wid-hig-100 border-50" mode=""></image>
		<view class="ml20">
			<view class="fontSize-32">{{item.nickname}} <text class="ml10">{{item.mobile}}</text></view>
			<view class="mar-top-16 fontSize-26">邀约时间:{{item.create_time}}</view>
		</view>
	</view>
	<view class="display-ce align-items" v-if="list.length==0">
		<tm-result :showBtn="false" subTitle=" " title="暂无数据" color="#bc8c1e"></tm-result>
	</view>
	</view>
</template>

<script lang="ts" setup>
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
import {team,getChildrenCount} from '@/utils/api'
import { ref } from 'vue';
onLoad(()=>{
	_getChildrenCount()
	_team()
})
onReachBottom(()=>{
	if(page.value>1){
		_team()
	}
})
const _getChildrenCount = () =>{
	getChildrenCount().then(res=>{
		if(res.code==1){
			num.value = res.data.children_total
		}
	})
}
const num = ref(0)
const page = ref(1)
const type = ref(1)
const list = ref([])
const _team = () =>{
	team({
		page:page.value,
		type:type.value,
		limit:10
	}).then(res=>{
		if(res.code==1){
			list.value = list.value.concat(res.data.user.data)
			if(res.data.user.data.length>0){
				page.value++
			}
		}
	})
}
</script>

<style lang="scss">
page{
	background:#f6f6f6;
}
	.my_bi_view{
		height: 240rpx;
		background: linear-gradient( 180deg, #F6911B 0%, #F8C44A 100%);
	}
.view_view{
	border-bottom: 3rpx solid #F9F9F9;
}
.top_view{
	height: 100rpx;
	.xian{
		height: 6rpx;
		background: #2DB295;
		border-radius: 4rpx 4rpx 4rpx 4rpx;
		width: 100%;
		bottom: 12rpx;
	}
}
</style>
